package com.crealth.mapper;

import java.sql.Timestamp;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.crealth.model.LoanContractModel;


public abstract interface LoanContractMapper {
	public abstract List<LoanContractModel> selectLoanContractByCompanyID(
			@Param("companyID")int companyID);
	
	public abstract List<LoanContractModel> selectAllLoanContract();
	
	public abstract Integer insertLoanContract(LoanContractModel contractModel);
	
	public abstract LoanContractModel selectLoanContractByID(
			@Param("contractID")int contractID);
	
	public abstract List<LoanContractModel> selectLoanContractByConsumerID(
			@Param("consumerID")int consumerID,
			@Param("userID")int userID);
	
	public abstract List<LoanContractModel> selectLoanContractByIDs(
			@Param("contractIDs")String contractIDs);
	
	public abstract List<LoanContractModel> selectLoanContractNotProduct(
			@Param("contractIDs")String contractIDs);
	
	public abstract List<Integer> selectConsumerInfoIDByIDs(
			@Param("contractIDs")String contractIDs);
	
	public abstract List<Integer> selectAllConsumerIDs();
	
	public abstract String selectMaxContractNo();
	
	public abstract Integer updateContractByID(LoanContractModel contract);
	
	//  修改  手续费、定金
	public abstract Integer updateExpenseEarnestByID(
			@Param("contractID")int contractID,
			@Param("expenseValue")String expenseValue,
			@Param("earnestMoney")String earnestMoney);
	
	public abstract Integer updateHasDelete(
			@Param("contractID")int contractID,
			@Param("setDel")int setDel);
	
	public abstract Integer updatePdfinfoUpload(
			@Param("contractID")int contractID,
			@Param("setUpload")int setUpload);
	
	public abstract Integer updateContractFileByID(
			@Param("contractID")int contractID,
			@Param("strFileName")String strFileName);
	
	public abstract Integer updateFileCoverByID(
			@Param("contractID")int contractID,
			@Param("fileCover")int fileCover);
	
	public abstract Integer updateContractStatusByID(
			@Param("contractID")int contractID,
			@Param("setStatus")int setStatus);
	
	public abstract List<LoanContractModel> selectAllErrorContract();
	
	public abstract Integer updateApplyForTmByID(
			@Param("contractID")int contractID,
			@Param("setTm")Timestamp setTm,
			@Param("setContractNo")String setContractNo);
	
	public abstract Integer selectContractNoNum();
	
	public abstract Integer updateMaxContractNo(
			@Param("maxContractNum")int maxContractNum);
	
	
	public abstract LoanContractModel selectContractByCondition(
			@Param("strCondition")String strCondition);
	
	public abstract Integer deleteContractByID(
			@Param("contractID")int contractID);
	
	public abstract Integer selectConsumerContractNum(
			@Param("contractID")int consumerID);
	
	public abstract List<Integer> selectHasContractConsumerID(
			@Param("strConsumerIDs")String strConsumerIDs);
	
	
	
}
